import sys
def main1():
    line = sys.stdin.readline()
    length = len(line)
    index = []
    for i in range(length):
        r1 = i % 2
        if r1 == 0 and line[i] == 'o':
            index.append(i)
    if index:
        print(index[-1])
    else:
        print(0)
def cal(line):
    index = []
    length = len(line)
    for i in range(length):
        r1 = i % 2
        if r1 == 0 and line[i] == 'o':
            index.append(i)
    if index:
        return index[-1]
    else:
        return 0

def main2():
    line = sys.stdin.readline()
    length = len(line)
    if length > 1:
        line2= line[1:] + line[0]
        r1 = cal(line)
        r2 = cal(line2)
        if r1 >= r2:
            print(r1)
        else:
            print(r2)
    elif length == 1:
        if line[0] == 'o':
            print(1)
    else:
        print(0)


if __name__ == "__main__":
    main2()
